package com.enzoism.controller;

import com.enzoism.config.initBean.AliyunAuto;
import com.enzoism.config.version.ApiVersion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("{version}")
@ApiVersion(1)
// 进行restful接口调用，直接返回Json数据
public class VersionController {

    @Value("${server.port}")
    String port;

    @Value("${spring.profiles.active}")
    String env;

    @Autowired
    private AliyunAuto aliyunAuto;

    @RequestMapping("/test1")
    public String home(String name) {
        return "hi " + name + ",i am from port:" + port + "  currentEnv:" + env + "  aliyunAuto:" + aliyunAuto;
    }
}